<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./template/template.xhtml">
            <ui:define name="title">
                <h:outputText value="#{bundle.CreateRealEstateTitle}"></h:outputText>
            </ui:define>
            <ui:define name="content">
                <h:panelGroup rendered="#{userManager.user==null}">            
                    #{userManager.userResponse1()}
                </h:panelGroup>
                <h:panelGroup id="messagePanel" layout="block">
                    <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                </h:panelGroup>
                <h:form enctype="multipart/form-data">

                    <fieldset>
                        <legend>Post Your Property</legend>
                        <table cellpadding="0" cellspacing="5" width="100%">  
                            <tr>
                                <td><span class="post_title_blue"> Your City: </span></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_cityID}" for="cityID" />
                                    <h:selectOneMenu id="cityID" value="#{controllerProperty.getrealestate().cityID}" title="#{bundle.CreateRealEstateTitle_cityID}" required="true" requiredMessage="#{bundle.CreateRealEstateRequiredMessage_cityID}">
                                        <f:selectItems value="#{citiesController.itemsAvailableSelectOne}"/>
                                    </h:selectOneMenu>  </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>  
                            <tr>
                                <td><span class="post_title_blue"> Your Location: </span></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td>  <h:outputLabel value="#{bundle.CreateRealEstateLabel_location}" for="location" />
                                    <h:inputText id="location" value="#{controllerProperty.getrealestate().location}" title="#{bundle.CreateRealEstateTitle_location}" required="true" requiredMessage="#{bundle.CreateRealEstateRequiredMessage_location}"/>
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue"> Deposit: </span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td>   <h:outputLabel value="#{bundle.CreateRealEstateLabel_deposit}" for="deposit" />
                                    <h:inputText id="deposit" value="#{controllerProperty.getrealestate().deposit}" title="#{bundle.CreateRealEstateTitle_deposit}" /></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue"> Your Price: </span></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td> <h:outputLabel value="#{bundle.CreateRealEstateLabel_price}" for="price" />
                                    <h:inputText id="price" value="#{controllerProperty.getrealestate().price}" title="#{bundle.CreateRealEstateTitle_price}" />  </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue"> Your Price Type: </span></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr>
                                <td> <h:outputLabel value="#{bundle.CreateRealEstateLabel_priceType}" for="priceType" />
                                    <h:inputText id="priceType" value="#{controllerProperty.getrealestate().priceType}" title="#{bundle.CreateRealEstateTitle_priceType}" /></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue"> No Bed Rooms </span></td>
                                <td></td>
                                <td></td>  
                            </tr>
                            <tr>
                                <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_noOfBedrooms}" for="noOfBedrooms" />
                                    <h:inputText id="noOfBedrooms" value="#{controllerProperty.getrealestate().noOfBedrooms}" title="#{bundle.CreateRealEstateTitle_noOfBedrooms}" /></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue"> No Bath Rooms </span></td>
                                <td></td>
                                <td></td>  
                            </tr>
                            <tr>
                                <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_noOfBathrooms}" for="noOfBathrooms" />
                                    <h:inputText id="noOfBathrooms" value="#{controllerProperty.getrealestate().noOfBathrooms}" title="#{bundle.CreateRealEstateTitle_noOfBathrooms}" />  </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Extra Facilities</span></td>
                                <td></td>
                                <td></td>  
                            </tr>
                            <tr>
                                <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_extraFacilities}" for="extraFacilities" />
                                    <h:inputText id="extraFacilities" value="#{controllerProperty.getrealestate().extraFacilities}" title="#{bundle.CreateRealEstateTitle_extraFacilities}" /></td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Modes Of Transport</span></td>
                                <td></td>
                                <td></td>  
                            </tr>
                            <tr>
                                <td>  <h:outputLabel value="#{bundle.CreateRealEstateLabel_modesOfTransport}" for="modesOfTransport" />
                                    <h:inputText id="modesOfTransport" value="#{controllerProperty.getrealestate().modesOfTransport}" title="#{bundle.CreateRealEstateTitle_modesOfTransport}" /></td>
                                <td></td>
                                <td></td>


                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Funiture</span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_furniture}" for="furniture" />
                                    <h:selectOneRadio id="furniture" value="#{controllerProperty.getrealestate().furniture}" title="#{bundle.CreateRealEstateTitle_furniture}" >
                                        <f:selectItem itemLabel="Yes" itemValue="true"/>
                                        <f:selectItem itemLabel="No" itemValue="false"/>
                                    </h:selectOneRadio>  </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">House Image</span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td> <h:outputLabel value="#{bundle.CreateRealEstateLabel_imageURL}" for="imageURL" /><t:inputFileUpload value="#{controllerProperty.uploadedFile}"/>  
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Mode Of Payment</span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td>   <h:outputLabel value="#{bundle.CreateRealEstateLabel_modeOfPayment}" for="modeOfPayment" />
                                    <h:inputText id="modeOfPayment" value="#{controllerProperty.getrealestate().modeOfPayment}" title="#{bundle.CreateRealEstateTitle_modeOfPayment}" /> </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Title</span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td>  <h:outputLabel value="#{bundle.CreateRealEstateLabel_title}" for="title" />
                                    <h:inputText id="title" value="#{controllerProperty.getrealestate().title}" title="#{bundle.CreateRealEstateTitle_title}" />
                                </td>
                                <td></td>
                                <td></td>
                            </tr>
                            <tr><td colspan="3"><hr/></td>
                            </tr>
                            <tr>
                                <td><span class="post_title_blue">Briefe Description</span></td>
                                <td></td>
                                <td></td> 
                            </tr>
                            <tr>
                                <td>   <h:outputLabel value="#{bundle.CreateRealEstateLabel_briefeDescription}" for="briefeDescription" />
                                    <h:inputText id="briefeDescription" value="#{controllerProperty.getrealestate().briefeDescription}" title="#{bundle.CreateRealEstateTitle_briefeDescription}" />
                                </td>
                                <td></td>
                                <td></td>


                                <tr><td colspan="3"><hr/></td>
                                </tr>                            
                                <tr><td colspan="3"><hr/></td>
                                </tr>
                                <tr>
                                    <td width="39%" height="24"><span class="post_title_blue"> Your RealEstate Type You Choose: </span></td>
                                    <td width="25%"></td>
                                    <td width="36%"></td>
                                </tr>
                                <tr>
                                    <td><h:outputLabel value="#{bundle.CreateRealEstateLabel_realEstateTypeID}" for="realEstateTypeID" />
                                        <h:selectOneMenu id="realEstateTypeID" value="#{controllerProperty.getrealestate().realEstateTypeID}" title="#{bundle.CreateRealEstateTitle_realEstateTypeID}" required="true" requiredMessage="#{bundle.CreateRealEstateRequiredMessage_realEstateTypeID}">
                                            <f:selectItems value="#{realEstateTypeController.itemsAvailableSelectOne}"/>
                                        </h:selectOneMenu>
                                    </td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>

                                    <td><strong>Sell</strong>: This means you would like to transfer complete  </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                                    <td >ownership of a property that you own to another party.</td>
                                </tr>
                                <tr>
                                    <td></td>   
                                    <td></td>
                                    <td ><strong>Rent</strong>: This means you would like to temporarily rent  </td>
                                </tr>
                                <tr>
                                    <td></td>
                                    <td></td>
                                    <td >your property to another party.</td>
                                </tr>
                                <tr><td colspan="3"><hr/></td>
                                </tr>                                           
                                <tr>
                                    <td><span class="post_title_blue"> Your House Type : </span></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td> <h:outputLabel value="#{bundle.CreateRealEstateLabel_houseTypeID}" for="houseTypeID" />
                                        <h:selectOneMenu id="houseTypeID" value="#{controllerProperty.getrealestate().houseTypeID}" title="#{bundle.CreateRealEstateTitle_houseTypeID}" >
                                            <f:selectItems value="#{houseTypeController.itemsAvailableSelectOne}"/>
                                        </h:selectOneMenu></td>
                                    <td></td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="2" rowspan="8" valign="top"><img class="dev" width="100" height="100" src="quangcao/cat_housing.gif" title="house"/><img class="dev" width="100" height="100" src="quangcao/cat_commercial.gif" title="commercial"/><img class="dev" width="100" height="100" src="quangcao/cat_shophouse.gif" title="shophouse"/><img class="dev" width="100" height="100" src="quangcao/Avalon.jpg" title="Building"/></td>
                                    <td><strong>Residential:</strong> The property you are listing is meant to </td>
                                </tr>
                                <tr>
                                    <td>be lived in </td>
                                </tr>
                                <tr>
                                    <td><strong>Commercial:</strong> The property you are listing is meant to </td>
                                </tr>
                                <tr>
                                    <td>be worked in. </td>
                                </tr>
                                <tr>
                                    <td><strong>Shop house:</strong> The property you are listing is meant to </td>
                                </tr>
                                <tr>
                                    <td>in and worked in. The property is dual purpose.</td>
                                </tr>
                                <tr>
                                    <td><strong>Land:</strong> Land for sale including hunting land, plantations </td>
                                </tr>
                                <tr>
                                    <td>ranches, development and investment land.</td>
                                </tr>
                                <tr>
                                    <td colspan="3"><hr/></td>
                                </tr>
                            </tr>
                        </table>
                    </fieldset>
                    <br/>
                    <br />

                    <br/>
                    <fieldset>
                        <legend>Create Your Contact</legend>
                        <h:panelGrid columns="2">
                            <h:outputLabel value="#{bundle.CreateContactPersonLabel_name}" for="name" />
                            <h:inputText id="name" value="#{controllerProperty.getSelectedcontact().name}" title="#{bundle.CreateContactPersonTitle_name}" required="true" requiredMessage="#{bundle.CreateContactPersonRequiredMessage_name}"/>
                            <h:outputLabel value="#{bundle.CreateContactPersonLabel_mobile}" for="mobile" />
                            <h:inputText id="mobile" value="#{controllerProperty.getSelectedcontact().mobile}" title="#{bundle.CreateContactPersonTitle_mobile}" required="true" requiredMessage="#{bundle.CreateContactPersonRequiredMessage_mobile}"> <f:validator validatorId="CheckMobileValid"/></h:inputText>
                            <h:outputLabel value="#{bundle.CreateContactPersonLabel_email}" for="email" />
                            <h:inputText id="email" value="#{controllerProperty.getSelectedcontact().email}" title="#{bundle.CreateContactPersonTitle_email}" ><f:validator validatorId="CheckEmailValid"/></h:inputText>

                        </h:panelGrid>

                    </fieldset>
                    <h:commandButton action="#{controllerProperty.createAll()}" value="Insert"/> 
                </h:form>
            </ui:define>

        </ui:composition>

    </body>
</html>
